<?php
/**
 * 用户分享锚点日志
 */
namespace App\Http\Model;


use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;

class UserAnchor extends Base
{
    protected $table = "user_share_log";
    protected $primaryKey = 'id';
    protected $fillable = ['id', 'user_id', 'to_user_id', 'action_type', 'source', 'target', 'value', 'add_time', 'remarks'];

    // 锚点类型
    protected $actionType = [
        // 废弃 'ShareAdChat' => '分享广告到私聊',
        // 废弃 'ShareAdDynamic' => '分享广告到动态',
        11 => '个人主页shareApp好友',
        12 => '个人主页share站外',
        21 => '房间shareApp好友',
        22 => '房间share站外',
        31 => '动态share好友',
        32 => '动态share站外',
        41 => '活动share好友',
        42 => '活动share动态',
        51 => 'CP空间share站外',
        61 => '密友空间share站外',
        71 => 'H5页面share站外',
    ];




    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
    }

    /**
     * 插入
     * @param array $data
     * @return bool
     */
    public function add( array $data)
    {
        return DB::table($this->table) -> insert($data);
    }

    /**
     * 获取分享类型list
     * @return array
     */
    public function getActionType()
    {
        return $this->actionType;
    }


}